﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UniMana.Utils.Helper
{
    public static class ClsReturnDayOfWeek
    {
        public static int convertToInt(DateTime m_dDateTime)
        {
            if ((m_dDateTime.DayOfWeek.ToString() == "Monday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Hai"))
                return 2;
            if ((m_dDateTime.DayOfWeek.ToString() == "Tuesday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Ba"))
                return 3;
            if ((m_dDateTime.DayOfWeek.ToString() == "Wednesday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Tư"))
                return 4;
            if ((m_dDateTime.DayOfWeek.ToString() == "Thursday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Năm"))
                return 5;
            if ((m_dDateTime.DayOfWeek.ToString() == "Friday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Sáu"))
                return 6;
            if ((m_dDateTime.DayOfWeek.ToString() == "Saturday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Bảy"))
                return 7;
            if ((m_dDateTime.DayOfWeek.ToString() == "Sunday") || (m_dDateTime.DayOfWeek.ToString() == "Chủ Nhật"))
                return 1;
            return 0;
        }

        public static string convertToString(DateTime m_dDateTime)
        {
            if ((m_dDateTime.DayOfWeek.ToString() == "Monday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Hai"))
                return "T2";
            if ((m_dDateTime.DayOfWeek.ToString() == "Tuesday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Ba"))
                return "T3";
            if ((m_dDateTime.DayOfWeek.ToString() == "Wednesday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Tư"))
                return "T4";
            if ((m_dDateTime.DayOfWeek.ToString() == "Thursday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Năm"))
                return "T5";
            if ((m_dDateTime.DayOfWeek.ToString() == "Friday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Sáu"))
                return "T6";
            if ((m_dDateTime.DayOfWeek.ToString() == "Saturday") || (m_dDateTime.DayOfWeek.ToString() == "Thứ Bảy"))
                return "T7";
            if ((m_dDateTime.DayOfWeek.ToString() == "Sunday") || (m_dDateTime.DayOfWeek.ToString() == "Chủ Nhật"))
                return "CN";
            return "CN";
        }
    }
}
